{% extends "eventyay_common/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% load urlreplace %}
{% block title %}{% translate "Organizers" %}{% endblock %}
{% block content %}
	<h1>{% translate "Organizers" %}</h1>
    <form class="row filter-form" action="" method="get">
        <div class="col-md-10 col-sm-6 col-xs-12">
            {% bootstrap_field filter_form.query layout='inline' %}
        </div>
        <div class="col-md-2 col-sm-6 col-xs-12">
            <button class="btn btn-primary btn-block" type="submit">
                <span class="fa fa-search"></span>
                <span class="hidden-md">
                    {% translate "Search" %}
                </span>
            </button>
        </div>
    </form>
    {% if staff_session %}
        <p>
            <a href='{% url "eventyay_common:organizers.add" %}' class="btn btn-default">
                <span class="fa fa-plus"></span>
                {% translate "Create a new organizer" %}
            </a>
        </p>
    {% endif %}
	<table class="table table-condensed table-hover">
		<thead>
			<tr>
                <th>
                    {% translate "Name" %}
                    <a href="?{% url_replace request 'ordering' '-name' %}"><i class="fa fa-caret-down"></i></a>
                    <a href="?{% url_replace request 'ordering' 'name' %}"><i class="fa fa-caret-up"></i></a>
                </th>
                <th>
                    {% translate "Short form" %}
                    <a href="?{% url_replace request 'ordering' '-slug' %}"><i class="fa fa-caret-down"></i></a>
                    <a href="?{% url_replace request 'ordering' 'slug' %}"><i class="fa fa-caret-up"></i></a>
                </th>
                <th class="text-right flip">
                    {% translate "Actions" %}
                </th>
			</tr>
		</thead>
		<tbody>
			{% for organizer in organizers %}
			<tr>
				<td><strong>
                    <a href='{% url "eventyay_common:organizer.update" organizer=organizer.slug %}'>{{ organizer.name }}</a>
                </strong></td>
                <td>{{ organizer.slug }}</td>
                <td class="text-right flip">
                    <a href='{% url "eventyay_common:organizer.update" organizer=organizer.slug  %}'
                            class="btn btn-sm btn-default" title='{% translate "Edit" %}'
                            data-toggle="tooltip">
                        <span class="fa fa-edit"></span>
                    </a>
                    <a href='{% url "control:organizer.teams" organizer=organizer.slug  %}'
                            class="btn btn-sm btn-default"
                            data-toggle="tooltip">Ticket Teams
                    </a>
                    <a href='/orga/organizer/{{ organizer.slug }}/teams/'
                            class="btn btn-sm btn-default"
                            data-toggle="tooltip">Talk Teams
                    </a>
                </td>
			</tr>
			{% endfor %}
		</tbody>
	</table>
    {% include "pretixcontrol/pagination.html" %}
{% endblock %}
